<?php

	$from=$email;
	$subject="SITE RAF [Fale Conosco]";
	$to="vedovelli@gmail.com";
	$msg=
<<<EOD
		<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#f4f4f4">
		  <tr>
		    <td>
		      <table width="100%" border="0" cellpadding="5" $style>
		        <tr bgcolor="#ffffff">
		          <td colspan="2">Abaixo seguem os dados postados no formulário da página <b>FALE CONOSCO</b>.</td>
		        </tr>
		        <tr bgcolor="#ffffff">
		          <td>Nome</td>
		          <td><b>$nome $sobrenome</b></td>
		        </tr>
		        <tr bgcolor="#ffffff">
		          <td height="30">Empresa</td>
		          <td height="30"><b>$empresa</b></td>
		        </tr>
		        <tr bgcolor="#ffffff">
		          <td height="30">E-mail</td>
		          <td height="30"><b>$email</b></td>
		        </tr>
		        <tr bgcolor="#ffffff">
		          <td nowrap width="1%" valign="top">Mensagem</td>
		          <td><b>$mensagem</b></td>
		        </tr>
		      </table>
		    </td>
		  </tr>
		</table>
EOD;

$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";
$headers .= "From: $from\n";
$headers .= "Return-Path: cr@camargorodrigues.com.br\n"; 

if(mail($to, $subject, $msg, $headers)){
	header("Location:obrigado.php");
	exit();
} else {
	header("Location:falha.php");
	exit();
}

?>